import java.util.ArrayList;
import java.util.List;

public class SX2 {
    public List<Integer> findNums(int[] arr) {
        List<Integer> res = new ArrayList<>();
        for (int i = 1; i < arr.length - 1; i++) {
            if (arr[i] >= arr[i - 1] && arr[i] <= arr[i + 1]) res.add(arr[i]);
        }
        return res;
    }
}
